package com.ranjiaqi.thread04;

/**
 * @ClassName TestJoin
 * @Description TODO
 * @Author hp
 * @Date 2021/6/28 18:34
 * @Version 1.0
 **/
public class TestJoin {
    public static void main(String[] args) {
        SubThread thread = new SubThread();
        SubThread thread1 = new SubThread();
        thread.start();
        //需要catch住异常，因为有可能在thread执行过程中被强制中断，导致线程1一直无法运行
        try {
            thread.join();
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        thread1.start();
    }
}
